<?php 
/*-----------------------------------------------------------------------------------*/
/* Argo Blog List Shortcode
/*-----------------------------------------------------------------------------------*/
add_shortcode( "bloglist", "argo_blog_shortcode" );
function argo_blog_shortcode($atts, $content = null) {
	$html = "<div class='row-fluid'><div id='gallery-x' class='carousel slide'> \n <div class='carousel-inner'>";
	
	$args = array('posts_per_page' => -1,
				  'post_type'            => 'post',
				);
	$the_query = new WP_Query( $args );
	if($the_query->have_posts()) :
		$i = 0;
		while ( $the_query->have_posts() ) : $the_query->the_post();
			$active = ($i==0)?'active':'';
			$html .= "<div class='span4'>";
			$html .= get_the_post_thumbnail(get_the_ID(), 'medium');
			$html .= "<p><a href='".get_permalink()."'>".get_the_title()."</a></p>";
			$html .= "</div>";
			$i++;
		endwhile;
	endif;
	
	$html .= "
		</div>\n
		<a class='left carousel-control' href='#gallery-x' data-slide='prev'>".__('Prev', 'argo')."</a>\n
		<a class='right carousel-control' href='#gallery-x' data-slide='next'>".__('Next', 'argo')."</a>
		</div>\n</div>\n";
	return $html;
}
